<template>
  <div class="public-activities">
    <h1>公开活动列表</h1>
    <div class="activity-list">
      <div v-for="activity in activities" :key="activity.id" class="activity-card">
        <h2>{{ activity.title }}</h2>
        <p>日期: {{ activity.date }}</p>
        <router-link :to="`/public-activities/${activity.id}`">查看详情</router-link>
      </div>
    </div>
  </div>
</template>

<script>
import activities from '@/data/activities';

export default {
  data() {
    return {
      activities
    };
  }
};
</script>

<style scoped>
.public-activities {
  max-width: 800px;
  margin: 0 auto;
}

.activity-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.activity-card {
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.activity-card h2 {
  font-size: 1.2em;
  margin-top: 0;
}
</style>